I finally got a new release of CAD::Drawing out the door. This didn't add any features besides whatever might have creeped into it in the last year (ok, there's that save to image thing, which is pretty neat.)
But this involved a lot of juggling support files. These modules started in their individual distributions with EU::MM and I had decided to move them to Module::Build as well as condensing them into 8 distributions (putting several modules in the "core" CAD::Drawing, but keeping the plugins as individual packages.)
Ok, enough setup. My e-mail address, employer, copyright dates, and several other global values have changed a few times and I wanted to get everything pounded into the same shape without mistakes, and without sed (not on the multiline stuff, please) and without writing a custom utility for each task. Note that the point was not to save time yesterday (though I may have managed that, it is a slim margin at best.) The point is to work toward something like a module_shepherd app which is going to be the <tron reference>MCP</tron reference> for my CPAN code.
Of course any self-respecting hacker knows what an adz(e) is right? Actually, now that I look for it, I can't find the definition that linked the two together. Oh well, this is a curved tool for hacking on your POD. 'Nuff said...
usage is just: podadz command <file> <directory>
. Where command is either "breakout" or "assemble" (for now.) So,
$ mkdir /tmp/pods $ find */trunk/lib -name '*.pm' \ > /tmp/pm_list $ for f in $(cat /tmp/pm_list) do p=$(echo $f | perl -pe \ 's#.*/lib/##;s/\.pm//; s#/#::#g;') podadz breakout $f /tmp/pods/$p done $ md5sum /tmp/pods/*/*AUTHOR
And that shows you fingerprints for all of your author sections. Note, the chunk filename is preceded by a number, which is all that really matters when we go to put it back together. Now say that you have a file /tmp/the_author with all of your current contact info:
head1 AUTHOR Just S. Omeguyhttp://thatguy.com
Note missing /^=/. That's part of the trick. I also throw in the "\n\n=cut\n" for free. You can symlink all of the author files to this bit...
$ for i in /tmp/pods/*/*head1_AUTHOR do rm $i; ln -s /tmp/the_author $i done
And then just reassemble...
$ for f in $(cat /tmp/pm_list) do p=$(echo $f | perl -pe \ 's#.*/lib/##;s/\.pm//; s#/#::#g;') podadz assemble $f /tmp/pods/$p done
Oh, and it uses PPI. It does eat your trailing whitespace on the first run-through, but is anyone really attached to those dangling 's?
More on this on my website.